package org.marker.mushroom.holder;

import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;
import java.io.File;

/**
 * Created by <a href="mailto:wallellen@hotmail.com">WALLE</a> on 4/13/16.
 */
public abstract class BaseServletContextAware implements ServletContextAware {
    /**
     * Web应用真实路径
     */
    public static String REAL_PATH;

    @Override
    public void setServletContext(ServletContext sc) {
        REAL_PATH = sc.getRealPath(File.separator);

        if (!REAL_PATH.endsWith("/")) {
            REAL_PATH += File.separator;
        }
    }
}
